home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 11
/
Cream of the Crop 11-1.iso
/
games
/
wskat30a.zip
/
SETUP.MS_
/
SETUP.bin
Wrap
Text File
|
1995-10-15
|
12KB
|
402 lines
'' Setup-Anweisungen fⁿr WinSkat
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST APPHELP = 900
CONST CUSTINST = 6200
CONST TOOBIG = 6300
CONST BADPATH = 6400
CONST LOGO = 1
CONST APPFILES = 1
CONST OPTFILES1 = 2
CONST OPTFILES2 = 3
CONST OPTFILES3 = 4
CONST OPTFILES4 = 5
CONST WM_FONTCHANGE = 29
CONST HWND_BROADCAST = -1
GLOBAL DEST$
GLOBAL WINDRIVE$
GLOBAL APPNEEDS$
GLOBAL OPT1NEEDS$
GLOBAL OPT2NEEDS$
GLOBAL OPT3NEEDS$
GLOBAL OPT4NEEDS$
GLOBAL EXTRACOSTS$
GLOBAL BIGLIST$
GLOBAL CHECKSTATES$
GLOBAL STATUSTEXT$
GLOBAL DRIVETEXT$
DECLARE SUB AddOptFilesToCopyList ( ftype% )
DECLARE SUB RecalcOptFiles ( ftype% )
DECLARE SUB RecalcPath
DECLARE SUB SetDriveStatus
DECLARE FUNCTION MakePath ( szDir$, szFile$ ) AS STRING
DECLARE FUNCTION CreateScalableFontResource LIB "GDI.EXE" (fHidden%, FOTFile$, TTFFile$, SysDir$) AS INTEGER
DECLARE FUNCTION AddFontResource LIB "GDI.EXE" (FOTFile$) AS INTEGER
DECLARE FUNCTION SendMessage LIB "USER.EXE" (hWnd%, Message%, wParam%, lParam&) AS LONG
INIT:
CUIDLL$ = "mscuistf.dll"
HELPPROC$ = "FHelpDlgProc"
SetBitmap CUIDLL$, LOGO
SetTitle "Fischer - Setup"
szInf$ = GetSymbolValue( "STF_SRCINFPATH" )
IF szInf$ = "" THEN
szInf$ = GetSymbolValue( "STF_CWDDIR" ) + "setup.inf"
END IF
ReadInfFile szInf$
WINDRIVE$ = MID$( GetWindowsDir, 1, 1 )
DEST$ = "C:\SPIELE\WINSKAT"
CHECKSTATES$ = "CheckItemsState"
STATUSTEXT$ = "StatusItemsText"
DRIVETEXT$ = "DriveStatusText"
AddListItem CHECKSTATES$, "ON"
AddListItem CHECKSTATES$, "ON"
AddListItem CHECKSTATES$, "ON"
AddListItem CHECKSTATES$, "ON"
AddListItem CHECKSTATES$, "OFF"
FOR i% = 1 TO 5 STEP 1
AddListItem STATUSTEXT$, ""
NEXT i%
FOR i% = 1 TO 7 STEP 1
AddListItem DRIVETEXT$, ""
NEXT i%
ReplaceListItem DRIVETEXT$, 7, DEST$
APPNEEDS$ = "AppNeeds"
OPT1NEEDS$ = "Opt1Needs"
OPT2NEEDS$ = "Opt2Needs"
OPT3NEEDS$ = "Opt3Needs"
OPT4NEEDS$ = "Opt4Needs"
EXTRACOSTS$ = "ExtraCosts"
BIGLIST$ = "BigList"
FOR i% = 1 TO 5 STEP 1
AddListItem BIGLIST$, ""
NEXT i%
FOR i% = 1 TO 26 STEP 1
AddListItem EXTRACOSTS$, "0"
NEXT i%
RecalcPath
SetDriveStatus
CUSTINST:
sz$ = UIStartDlg( CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$ )
IF sz$ = "CONTINUE" THEN
FOR i% = 1 TO 5 STEP 1
IF GetListItem( BIGLIST$, i% ) <> "" THEN
GOSUB TOOBIG
GOTO CUSTINST
END IF
NEXT i%
IF GetListItem( CHECKSTATES$, APPFILES ) = "ON" THEN
MajorVer% = GetWindowsMajorVersion()
MinorVer% = GetWindowsMinorVersion()
Processor% = GetProcessorType()
IF MajorVer% < 3 OR ( MajorVer% = 3 AND MinorVer% < 10 ) THEN
i% = DoMsgBox( "Skat fⁿr Windows ben÷tigt mindestens Microsoft Windows, Version 3.10!", "Fischer - Setup", MB_OK + MB_TASKMODAL + MB_ICONHAND )
GOTO CUSTINST
END IF
IF Processor% < 3 THEN
i% = DoMsgBox( "Skat fⁿr Windows ben÷tigt mindestens einen 386er - Prozessor!", "Fischer - Setup", MB_OK + MB_TASKMODAL + MB_ICONHAND )
GOTO CUSTINST
END IF
IF GetListItem( CHECKSTATES$, OPTFILES1 ) = "OFF" THEN
IF GetListItem( CHECKSTATES$, OPTFILES2 ) = "OFF" THEN
i% = DoMsgBox( "Skat fⁿr Windows braucht auch Karten!", "Fischer - Setup", MB_OK + MB_TASKMODAL + MB_ICONHAND )
GOTO CUSTINST
END IF
END IF
END IF
UIPop 1
GOTO INSTALL
ELSEIF sz$ = "PATH" THEN
GOTO GETPATH
ELSEIF sz$ = "CHK1" THEN
RecalcOptFiles APPFILES
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "CHK2" THEN
RecalcOptFiles OPTFILES1
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "CHK3" THEN
RecalcOptFiles OPTFILES2
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "CHK4" THEN
RecalcOptFiles OPTFILES3
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "CHK5" THEN
RecalcOptFiles OPTFILES4
SetDriveStatus
GOTO CUSTINST
ELSEIF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO CUSTINST
ELSE
GOSUB ASKQUIT
GOTO CUSTINST
END IF
INSTALL:
ClearCopyList
AddOptFilesToCopyList APPFILES
AddOptFilesToCopyList OPTFILES1
AddOptFilesToCopyList OPTFILES2
AddOptFilesToCopyList OPTFILES3
AddOptFilesToCopyList OPTFILES4
CreateDir DEST$, cmoNone
CopyFilesInCopyList
IF GetListItem( CHECKSTATES$, APPFILES ) = "ON" THEN
CreateProgmanItem "Spiele", "WinSkat", MakePath( DEST$, "wskat.exe" ), "", cmoOverwrite
CreateProgmanItem "Spiele", "WinSkat Hilfe", "winhelp.exe "+ MakePath( DEST$, "wskat.hlp" ), "", cmoOverwrite
CreateProgmanItem "Spiele", "WinSkat Tips", "notepad.exe "+ MakePath( DEST$, "tips.txt" ), "", cmoOverwrite
SYSDIR$ = GetWindowsSysDir()
i% = CreateScalableFontResource ( 0, SYSDIR$ + "QUILLSCN.FOT", "QUILLSCN.TTF", SYSDIR$ )
i% = AddFontResource ( SYSDIR$ + "QUILLSCN.FOT" )
FontName$ = STRING$( 64, 32 )
i% = GetTypeFaceNameFromTTF( SYSDIR$ + "QUILLSCN.TTF", FontName$, 64 )
CreateIniKeyValue "WIN.INI", "fonts", FontName$ +" (TrueType)", "QUILLSCN.FOT", cmoOverwrite
i% = SendMessage ( HWND_BROADCAST, WM_FONTCHANGE, 0, 0 )
END IF
IF GetListItem( CHECKSTATES$, OPTFILES4 ) = "ON" THEN
CreateProgmanItem "Spiele", "DosSkat", MakePath( DEST$, "dos\skat.pif" ), MakePath( DEST$, "dos\skat.ico" ), cmoOverwrite
CreateProgmanItem "Spiele", "DosSkat Anleitung", "notepad.exe "+ MakePath( DEST$, "dos\skat.anl" ), "", cmoOverwrite
END IF
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
sz$ = UIStartDlg( CUIDLL$, dlg%, "FInfo0DlgProc", 0, "" )
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
END
ERRQUIT:
i% = DoMsgBox( "Dieser Diskettensatz ist fehlerhaft!", "Fischer - Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND )
END
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg( CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$ )
IF sz$ = "CONTINUE" THEN
olddest$ = DEST$
DEST$ = GetSymbolValue( "EditTextOut" )
IF IsDirWritable( DEST$ ) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
IF LEN( DEST$ ) > 23 THEN
ReplaceListItem DRIVETEXT$, 7, MID$( DEST$, 1, 23 )+"..."
ELSE
ReplaceListItem DRIVETEXT$, 7, DEST$
END IF
IF ( olddest$ <> DEST$ ) AND ( olddest$ <> DEST$+"\" ) AND ( olddest$+"\" <> DEST$ ) THEN
RecalcPath
SetDriveStatus
END IF
olddest$ = ""
GOTO CUSTINST
ELSEIF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO GETPATHL1
ELSEIF sz$ = "EXIT" THEN
GOSUB ASKQUIT
GOTO GETPATHL1
ELSE
UIPop 1
GOTO CUSTINST
END IF
TOOBIG:
sz$ = UIStartDlg( CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "" )
IF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO TOOBIG
END IF
UIPop 1
RETURN
BADPATH:
sz$ = UIStartDlg( CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "" )
IF sz$ = "REACTIVATE" THEN
RecalcPath
SetDriveStatus
GOTO BADPATH
END IF
UIPop 1
RETURN
ASKQUIT:
sz$ = UIStartDlg( CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "" )
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
SUB AddOptFilesToCopyList ( ftype% ) STATIC
IF GetListItem( CHECKSTATES$, ftype% ) = "ON" THEN
SrcDir$ = GetSymbolValue( "STF_SRCDIR" )
IF ftype% = APPFILES THEN
AddSectionFilesToCopyList "REMOVE", SrcDir$, GetWindowsDir()
AddSectionFilesToCopyList "WSkat", SrcDir$, DEST$
AddSectionFilesToCopyList "SKS", SrcDir$, MakePath( DEST$, "SKS" )
AddSectionFilesToCopyList "WIN", SrcDir$, GetWindowsDir()
AddSectionFilesToCopyList "SYS", SrcDir$, GetWindowsSysDir()
ELSEIF ftype% = OPTFILES1 THEN
AddSectionFilesToCopyList "DKarten", SrcDir$, DEST$
ELSEIF ftype% = OPTFILES2 THEN
AddSectionFilesToCopyList "FKarten", SrcDir$, DEST$
ELSEIF ftype% = OPTFILES3 THEN
AddSectionFilesToCopyList "WAV", SrcDir$, MakePath( DEST$, "WAV" )
ELSEIF ftype% = OPTFILES4 THEN
AddSectionFilesToCopyList "DOS", SrcDir$, MakePath( DEST$, "DOS" )
END IF
SrcDir$ = ""
END IF
END SUB
SUB RecalcOptFiles ( ftype% ) STATIC
CursorSave% = ShowWaitCursor( )
ClearCopyList
AddOptFilesToCopyList ftype%
fExtra% = 0
IF ftype% = APPFILES THEN
ListSym$ = APPNEEDS$
IF GetListItem( CHECKSTATES$, APPFILES ) = "ON" THEN
ndrive% = ASC( ucase$( WINDRIVE$ ) ) - ASC( "A" ) + 1
ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
fExtra% = 1
END IF
ELSEIF ftype% = OPTFILES1 THEN
ListSym$ = OPT1NEEDS$
ELSEIF ftype% = OPTFILES2 THEN
ListSym$ = OPT2NEEDS$
ELSEIF ftype% = OPTFILES3 THEN
ListSym$ = OPT3NEEDS$
ELSEIF ftype% = OPTFILES4 THEN
ListSym$ = OPT4NEEDS$
END IF
StillNeed& = GetCopyListCost( EXTRACOSTS$, ListSym$, "" )
cost& = 0
FOR i% = 1 TO 26 STEP 1
cost& = cost& + VAL( GetListItem( ListSym$, i% ) )
NEXT i%
ReplaceListItem STATUSTEXT$, ftype%, STR$( cost& / 1024 ) + " K"
IF StillNeed& > 0 THEN
ReplaceListItem BIGLIST$, ftype%, "YES"
ELSE
ReplaceListItem BIGLIST$, ftype%, ""
END IF
IF fExtra% THEN
ReplaceListItem EXTRACOSTS$, ndrive%, "0"
END IF
RestoreCursor CursorSave%
ListSym$ = ""
END SUB
SUB RecalcPath STATIC
CursorSave% = ShowWaitCursor( )
RecalcOptFiles APPFILES
RecalcOptFiles OPTFILES1
RecalcOptFiles OPTFILES2
RecalcOptFiles OPTFILES3
RecalcOptFiles OPTFILES4
RestoreCursor CursorSave%
END SUB
SUB SetDriveStatus STATIC
drive$ = MID$( DEST$, 1, 1 )
ndrive% = ASC( ucase$( drive$ ) ) - ASC( "A" ) + 1
cost& = VAL( GetListItem( APPNEEDS$, ndrive% ) ) + VAL( GetListItem( OPT1NEEDS$, ndrive% ) ) + VAL( GetListItem( OPT2NEEDS$, ndrive% ) ) + VAL( GetListItem( OPT3NEEDS$, ndrive% ) ) + VAL( GetListItem( OPT4NEEDS$, ndrive% ) )
free& = GetFreeSpaceForDrive( drive$ )
ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
ReplaceListItem DRIVETEXT$, 2, STR$( cost& / 1024 ) + " K"
ReplaceListItem DRIVETEXT$, 3, STR$( free& / 1024 ) + " K"
END SUB
FUNCTION MakePath ( szDir$, szFile$ ) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$( szDir$, LEN( szDir$ ), 1 ) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION